#include<stdio.h>
#include<math.h>
int main()
{
    int s, v;
    scanf("%d %d", &s, &v);
    double time = ceil(s * 1.0 / v) + 10;
    int a = (8 + 24) * 60;
    a = a - time;
    if(a >= 24 * 60) a -= 24 * 60;
    int h = a / 60;
    int m = a % 60;
    if(m >= 60)
    {
        h ++;
        m -= 60;
    }
    printf("%02d:%02d\n", h, m);
    return 0;
}
/*
8：00 time = 75
a = 8 * 60 - 75 = 405
h = 405 / 60 = 6
m = 450 % 60 = 75
75 > 60
h ++;
m -= 60;
*/